<?php include("../components/autoload.php"); ?>
<?php include("../components/functions.php"); ?>
<?php include("../../components/connection.php"); ?>

<?php
	@header('Content-Type: text/html; charset=UTF-8'); 
	
	$article = new Article($_GET['id']);
	
	if(file_exists('../../media/vesti/slike/'.$article->slika)) {
		if (unlink ('../../media/vesti/slike/'.$article->slika)) echo "Slika obrisana!<br />";
	}
	
	if(file_exists('../../media/vesti/thumbs/'.$article->slika)) {
		if (unlink ('../../media/vesti/thumbs/'.$article->slika)) echo "Thumb obrisan!<br />";
	}
		
	$q = "DELETE FROM vest WHERE id = ". $article->id;
	if (mysql_query($q)) echo "Obrisana vest iz baze podataka!<br />";
		
	unset($article);
	
?>